<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>相对定位以绝对定位</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .wrapper {
            padding: 30px;
            position: relative;
            background-color: lavender;
            position: relative;;
        }
        .a .b .c {
            height: 100px;
            padding: 10px;
        }
        .a {
            background-color: red;
            /* 默认的position定位: static */
            /* 1. absolute是相对于父节点（有定位的情况下）而定位，往上递增，最终到body */
            /* 2. relative是相对于节点顺序排列定位，只有left和top有效 */
            /* 3. fiexd是相对于父节点（不管有没有定位的情况下）而定位，如网页中右下角添加一个"回到顶部"按钮 */
            position: absolute;
            right: 0;
            bottom: 0;
        }
        .b {
            background-color: blue;
        }
        .c {
            background-color: yellow;
        }
    </style>
</head>
<body>
    
    <div class="wrapper">
        <div class="a">A</div>
        <div class="b">B</div>
        <div class="c">C</div>
    </div>
</body>
</html>
